-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename enum test add_to_sizeenum to add_enumclass_enumerator * Add enum test remove_enumclass_enumerator * Add enum test add_enum_enumerator * Add enum test remove_enum_enumerator * Update function-pointer/Makefile to new format * Add function-pointer breaks * Add complex-double breaks
- Loading branch information
Showing
37 changed files
with
582 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
extern "C" void test_long_double__Complex(long double _Complex x) {} | ||
void foo(double _Complex c1, double _Complex c2) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
extern "C" void test_long_double__Complex(long double _Complex x) {} | ||
void foo(float _Complex c1, float _Complex c2) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
enum Color { red, green, blue, orange }; | ||
|
||
enum class ColorClassEnum : int { red=-77, blue=14, green=0 }; | ||
void foo(ColorClassEnum c) {} | ||
|
||
Color print_color(Color r){ | ||
return r; | ||
} | ||
|
||
// Enums with different sizes underlying types | ||
enum class CharEnum : char {h='h', i='i', j='j'}; | ||
enum class BoolEnum : bool { a=true, b=false}; | ||
enum class SizeEnum : unsigned long { a=1, b=2, c=3}; | ||
|
||
void enumfunc(CharEnum c) {} | ||
void boolfunc(BoolEnum c) {} | ||
void sizefunc(SizeEnum c) {} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
enum Color { red, green }; | ||
|
||
enum class ColorClassEnum : int { red=-77, blue=14, green=0 }; | ||
void foo(ColorClassEnum c) {} | ||
|
||
Color print_color(Color r){ | ||
return r; | ||
} | ||
|
||
// Enums with different sizes underlying types | ||
enum class CharEnum : char {h='h', i='i', j='j'}; | ||
enum class BoolEnum : bool { a=true, b=false}; | ||
enum class SizeEnum : unsigned long { a=1, b=2, c=3}; | ||
|
||
void enumfunc(CharEnum c) {} | ||
void boolfunc(BoolEnum c) {} | ||
void sizefunc(SizeEnum c) {} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
enum Color { red, green, blue }; | ||
|
||
enum class ColorClassEnum : int { red=-77, blue=14, green=0 }; | ||
void foo(ColorClassEnum c) {} | ||
|
||
Color print_color(Color r){ | ||
return r; | ||
} | ||
|
||
// Enums with different sizes underlying types | ||
enum class CharEnum : char {h='h', i='i', j='j'}; | ||
enum class BoolEnum : bool { a=true, b=false}; | ||
enum class SizeEnum : unsigned long { a=1, b=2}; | ||
|
||
void enumfunc(CharEnum c) {} | ||
void boolfunc(BoolEnum c) {} | ||
void sizefunc(SizeEnum c) {} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
g++ -g -c example.cpp -o lib.so | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
30 changes: 30 additions & 0 deletions
30
function-pointer/breaks/param_narrow_no_conversion/example.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// C++ program to pass function as a | ||
// pointer to any function | ||
|
||
// Function that add two numbers | ||
int add(char x, char y) | ||
{ | ||
return x + y; | ||
} | ||
|
||
// Function that multiplies two | ||
// numbers | ||
int multiply(char x, char y) | ||
{ | ||
return x * y; | ||
} | ||
|
||
// Function that takes a pointer | ||
// to a function | ||
int invoke(int x, int y, | ||
int (*func)(char, char)) | ||
{ | ||
return func(x, y); | ||
} | ||
|
||
// Driver Code | ||
int main() | ||
{ | ||
// Pass pointers to add & multiply | ||
return invoke(20,10,&add) + invoke(20,10,&multiply); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// C++ program to pass function as a | ||
// pointer to any function | ||
|
||
// Function that add two numbers | ||
int add(unsigned char x, unsigned char y) | ||
{ | ||
return x + y; | ||
} | ||
|
||
// Function that multiplies two | ||
// numbers | ||
int multiply(unsigned char x, unsigned char y) | ||
{ | ||
return x * y; | ||
} | ||
|
||
// Function that takes a pointer | ||
// to a function | ||
int invoke(int x, int y, | ||
int (*func)(unsigned char, unsigned char)) | ||
{ | ||
return func(x, y); | ||
} | ||
|
||
// Driver Code | ||
int main() | ||
{ | ||
// Pass pointers to add & multiply | ||
return invoke(20,10,&add) + invoke(20,10,&multiply); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
30 changes: 30 additions & 0 deletions
30
function-pointer/breaks/param_no_narrow_unsigned/example.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// C++ program to pass function as a | ||
// pointer to any function | ||
|
||
// Function that add two numbers | ||
int add(unsigned int x, unsigned int y) | ||
{ | ||
return x + y; | ||
} | ||
|
||
// Function that multiplies two | ||
// numbers | ||
int multiply(unsigned int x, unsigned int y) | ||
{ | ||
return x * y; | ||
} | ||
|
||
// Function that takes a pointer | ||
// to a function | ||
int invoke(int x, int y, | ||
int (*func)(unsigned int, unsigned int)) | ||
{ | ||
return func(x, y); | ||
} | ||
|
||
// Driver Code | ||
int main() | ||
{ | ||
// Pass pointers to add & multiply | ||
return invoke(20,10,&add) + invoke(20,10,&multiply); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
30 changes: 30 additions & 0 deletions
30
function-pointer/breaks/param_widen_no_conversion/example.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// C++ program to pass function as a | ||
// pointer to any function | ||
|
||
// Function that add two numbers | ||
int add(long int x, long int y) | ||
{ | ||
return x + y; | ||
} | ||
|
||
// Function that multiplies two | ||
// numbers | ||
int multiply(long int x, long int y) | ||
{ | ||
return x * y; | ||
} | ||
|
||
// Function that takes a pointer | ||
// to a function | ||
int invoke(int x, int y, | ||
int (*func)(long int, long int)) | ||
{ | ||
return func(x, y); | ||
} | ||
|
||
// Driver Code | ||
int main() | ||
{ | ||
// Pass pointers to add & multiply | ||
return invoke(20,10,&add) + invoke(20,10,&multiply); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// C++ program to pass function as a | ||
// pointer to any function | ||
|
||
// Function that add two numbers | ||
int add(long unsigned int x, long unsigned int y) | ||
{ | ||
return x + y; | ||
} | ||
|
||
// Function that multiplies two | ||
// numbers | ||
int multiply(long unsigned int x, long unsigned int y) | ||
{ | ||
return x * y; | ||
} | ||
|
||
// Function that takes a pointer | ||
// to a function | ||
int invoke(int x, int y, | ||
int (*func)(long unsigned int, long unsigned int)) | ||
{ | ||
return func(x, y); | ||
} | ||
|
||
// Driver Code | ||
int main() | ||
{ | ||
// Pass pointers to add & multiply | ||
return invoke(20,10,&add) + invoke(20,10,&multiply); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
30 changes: 30 additions & 0 deletions
30
function-pointer/breaks/param_widen_with_conversion/example.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// C++ program to pass function as a | ||
// pointer to any function | ||
|
||
// Function that add two numbers | ||
int add(double x, double y) | ||
{ | ||
return x + y; | ||
} | ||
|
||
// Function that multiplies two | ||
// numbers | ||
int multiply(double x, double y) | ||
{ | ||
return x * y; | ||
} | ||
|
||
// Function that takes a pointer | ||
// to a function | ||
int invoke(int x, int y, | ||
int (*func)(double, double)) | ||
{ | ||
return func(x, y); | ||
} | ||
|
||
// Driver Code | ||
int main() | ||
{ | ||
// Pass pointers to add & multiply | ||
return invoke(20,10,&add) + invoke(20,10,&multiply); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CXX ?= g++ | ||
CXXFLAGS ?= -g -Wall | ||
|
||
ifneq (${VERBOSE},1) | ||
MUTE := @ | ||
endif | ||
|
||
all: | ||
${MUTE} ${CXX} ${CXXFLAGS} -Wl,-E -fPIC -shared -o lib.so example.cpp |
Oops, something went wrong.